//
//  SSGameOverScene.m
//  iPig_iPhone
//
//  Created by shanshan on 10-7-11.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "SSGameOverLayer.h"
#import "SSMenuScene.h"
#import "SSHighScoreScene.h"

@implementation SSGameOverLayer


-(id)init{
	self = [super init];
	
	if(self != nil)
	{
		CMLog(@"in SSGameOverLayer");
		self.isTouchEnabled = YES;
		
		CGSize size = [[CCDirector sharedDirector] winSize];
		
		CCSprite *bg = [CCSprite spriteWithFile:@"popback.png"];
		bg.position = ccp(size.width /2, size.height/2);
		[self addChild:bg];
		
		//SSLogoLayer *logoLayer = [SSLogoLayer node];
//        [self addChild:logoLayer];
		
		//[CCMenuItemFont setFontName:@"Arial"];
		[CCMenuItemFont setFontSize:20];

	//	CCMenuItem *menuItem1 = [CCMenuItemImage itemFromNormalImage:@"options_close.png" selectedImage:@"options_open.png" disabledImage:@"options_open.png" target:self selector:@selector(onNext:)];
	
		//	CCMenuItem *menuItem1 = [CCMenuItemImage :NSLocalizedString(@"Next", @"Next") target:self selector:@selector(onNext:)];
		//CCMenuItemToggle *menuItem1 = [CCMenuItemToggle itemWithTarget:self selector:@selector(onNext:) items:
//											 [CCMenuItemImage itemFromNormalImage:@"options_close.png" selectedImage:@"options_close.png"],
//											 [CCMenuItemImage itemFromNormalImage:@"options_open.png" selectedImage:@"options_open.png"],
//		nil];
		CCMenuItem *menuItem1 = [CCMenuItemFont itemFromString:NSLocalizedString(@"Play", @"Play") target:self selector:@selector(onNext:)];
		CCMenuItem *menuItem2 = [CCMenuItemFont itemFromString:NSLocalizedString(@"Extra", @"Extra") target:self selector:@selector(onNext:)];

		
		CCMenu *menu = [CCMenu menuWithItems:menuItem1, menuItem2, nil];

		[menu alignItemsHorizontallyWithPadding:10];

		menu.position = ccp(size.width/2, size.height/2);

		[self addChild:menu];
	}
	return self;
}

- (void) onNext:(id)sender
{
	CMLog(@"onNext");
//	[[CCDirector sharedDirector] resume];
//	[[CCDirector sharedDirector] replaceScene:[SSMenuScene node]];
//	[[CCDirector sharedDirector] replaceScene:[SSHighScoreScene node]];
	CMLog(@"2222o2nNext");
}

@end
